<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>title</title>
  <style>
    img{
position: absolute;
    }
  </style>
</head>
<body>
<img src="images/tianshi.gif">
<script>
  let img = document.querySelector("img");
  //鼠标在页面中移动,图片跟着鼠标移动
  document.onmousemove=(e) => {
    //鼠标的移动的横纵坐标
    //可视区域的横坐标
    //可视区域的纵坐标
    img.style.left=e.clientX+"px";
    img.style.top=e.clientY+"px";
  };
</script>
</body>
</html>